$(function (){
    $("#search_btn").on("click",function (){
        // alert(1)
        var keyword = $(this).siblings("input").val();
        if(keyword){
            keyArr.push(keyword);
           
            localStorage.setItem("keyArr",JSON.stringify(keyArr));
            location.href = "seacher_result.html?keyword="+keyword;
        } else {
            // alert("请输入搜索商品")
            mui.toast("请输入商品名称")
        }
    })
    var keyArr=[];
if(localStorage.getItem("keyArr")){
    keyArr = JSON.parse(localStorage.getItem("keyArr"));

    var html = template('lishi1',{result:keyArr});
    // console.log(html)
    $("#li_shi").html(html);

    $("#del").on("click",function(){
        $("#li_shi").html("");
        keyArr=[];
        localStorage.removeItem("keyArr");
    })

}
});


